local skel = fk.CreateSkill {
  name = "emo__xiangu",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__xiangu"] = "仙骨",
  [":emo__xiangu"] = "锁定技，你的攻击范围加9；你的摸牌和弃牌阶段改为出牌阶段；出牌阶段开始时，你摸一张牌。",
}

skel:addEffect(fk.EventPhaseChanging, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and (data.phase == Player.Draw or data.phase == Player.Discard)
  end,
  on_use = function(self, event, target, player, data)
    player.room:sendLog{
      type = "#PhaseChanged",
      from = player.id,
      arg = Util.PhaseStrMapper(data.phase),
      arg2 = "phase_play",
    }
    data.phase = Player.Play
  end,
})

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player.phase == Player.Play
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, skel.name)
  end,
})

skel:addEffect("atkrange", {
  correct_func = function (self, from, to)
    if from:hasSkill(skel.name) then
      return 9
    end
  end,
})

return skel
